﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using QLChoDiaOc.Process;
using System.Data;

namespace QLChoDiaOc.Forms
{
    /// <summary>
    /// Interaction logic for FormKHTheoMoiLoaiQC.xaml
    /// </summary>
    public partial class FormKHTheoMoiLoaiQC : Page
    {
        SelectInfo _selectInfo = new SelectInfo();
        ShowInfo _showInfo = new ShowInfo();
        OtherHandle _otherHandle = new OtherHandle();
        static DataTable _dataTable = new DataTable();

        public FormKHTheoMoiLoaiQC()
        {
            InitializeComponent();
        }

        //private void btnThongKe_Click(object sender, RoutedEventArgs e)
        //{
        //    if (QCBangRadioButton.IsChecked == true)
        //        _showInfo.ShowDSKhachHangQCBang(dataKhachHang);
        //    if (QCBaoRadioButton.IsChecked == true)
        //        _showInfo.ShowDSKhachHangQCBang(dataKhachHang);
        //    if (QCToBuomRadioButton.IsChecked == true)
        //        _showInfo.ShowDSKhachHangQCToBuom(dataKhachHang);
        //}

        private void QCBaoRadioButton_Click(object sender, RoutedEventArgs e)
        {
            dataKhachHang.ItemsSource = null;
            _showInfo = new ShowInfo();
            _showInfo.ShowDSKhachHangQCBao(dataKhachHang, ref _dataTable);
            _otherHandle.TiLeQuangCao("Bao", ref MotQCTextBox, ref TongQCTextBox, ref TiLeTextBox);
        }

        private void QCBangRadioButton_Click(object sender, RoutedEventArgs e)
        {
            dataKhachHang.ItemsSource = null;
            _showInfo = new ShowInfo();
            _showInfo.ShowDSKhachHangQCBang(dataKhachHang, ref _dataTable);
            _otherHandle.TiLeQuangCao("Bang", ref MotQCTextBox, ref TongQCTextBox, ref TiLeTextBox);
        }

        private void QCToBuomRadioButton_Click(object sender, RoutedEventArgs e)
        {
            dataKhachHang.ItemsSource = null;
            _showInfo = new ShowInfo();
            _showInfo.ShowDSKhachHangQCToBuom(dataKhachHang, ref _dataTable);
            _otherHandle.TiLeQuangCao("ToBuom", ref MotQCTextBox, ref TongQCTextBox, ref TiLeTextBox);
        }

        private void btnReport_Click(object sender, RoutedEventArgs e)
        {
            DataSet _dataSet = new DataSet();
            _dataSet = _otherHandle.ConvertDataTableToDataSet(_dataTable);
            Export.exportExcel("Danh Sách Khách Hàng Chọn Quảng Cáo", _dataSet);
        }
    }
}
